package com.itheima.d2_Stream;

import java.util.*;
import java.util.stream.Stream;

/**
 * 集合、数组Stream流实现
 */
public class demo2 {

    public static void main(String[] args) {
        /** -----------------------------Collection-------------------------- */
        Collection<String> list1 = new ArrayList<>();
        Stream<String> stream = list1.stream();

        /** -----------------------------Map-------------------------- */
        Map<String,Integer> map =new HashMap<>();
        //1.键流
        Stream<String> stream1 = map.keySet().stream();
        //2.值流
        Stream<Integer> stream2 = map.values().stream();
        //3.键值对流
        Stream<Map.Entry<String ,Integer>> stream3 = map.entrySet().stream();

        /** -----------------------------Array-------------------------- */
        String[] names = {"1","212a","3fa24"};
        //1.
        Stream<String> stream4 = Arrays.stream(names);
        //2.
        Stream<String> stream5 = Stream.of(names);

    }
}
